package com.zb.framework.wechatnews.config;

import com.zb.framework.common.constant.Global;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;
import java.util.List;


/**
 * swagger配置
 * @author zzw
 */
@Configuration
@EnableSwagger2
public class Swagger2Config {

	@Bean
    public Docket api() {

        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select()
                // 自行修改为自己的包路径
                .apis(RequestHandlerSelectors.basePackage("com.zb"))
                .paths(PathSelectors.any())
                .build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("企业微信消息推送API")
                .description("企业微信消息推送API")
                //服务条款网址
                .termsOfServiceUrl("http://oa.zhengbang.com/login/Login.jsp?logintype=1")
                .version("1.0")
                .contact(new Contact("L.W.L", "http://oa.zhengbang.com/login/Login.jsp?logintype=1", "539999402@qq.com"))
                .build();
    }

}
